Page ({


  onLoad () {

    // var list = ["1","2","4"];

    // console.log(list);

    // var num = 0;
    // for (let index = 0; index < list.length; index++) {

    //   var x = Number(list[index]);
    //    num += x;
    // }

    // console.log(num);


    ////// 求数组最大值

    // var list = [1,3,10,2,6,5,4,7];

    // var max = 0;
    // for (let index = 0; index < list.length; index++) {

    //   if (max < list[index]) {
    //       max = list[index]
    //   }
      
    // }

    // console.log("最大值是",max);


    ////////// 给数组添加元素

    // var list = [1,4,5,436,66];

    // list.push(444,555,666);
    // list.push(999999999);

    // console.log(list);


    //////////// 数组删除元素

    var list = [1111,3,33,4,55,612,566,223];
    var newList = [];

    for (let index = 0; index < list.length; index++) {
      
      if(list[index] != 4){

        newList.push(list[index]);
        
      }
      
    }

    console.log(newList);


  }



})